﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Net.Http
{
    /// <summary>
    /// Token管理器
    /// </summary>
    public interface ITokenManager
    {
        string TokenHeaderName { get; }
        /// <summary>
        /// 根据Token获取身份信息。获取失败返回Empty
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        IdentityInfo GetIdentity(string token);
        /// <summary>
        /// 创建此身份信息的Token
        /// </summary>
        /// <param name="identityInfo"></param>
        /// <returns></returns>
        string CreateToken(IdentityInfo identityInfo);
    }
}
